<!DOCTYPE html>
<html>
<head lang="zh-cn">
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>酷设联盟</title>
    <!--<link rel="stylesheet" href="bootstrap.min.css">-->
    <link rel="stylesheet" href="http://cdn.bootcss.com/bootstrap/3.3.4/css/bootstrap.min.css">
    <link rel="stylesheet" href="css/style.css">
    <link rel="stylesheet" href="css/layout.css">
    <link rel="stylesheet" href="css/format.css">

    <style>
        .cropit-image-preview {
            background-color: #f8f8f8;
            background-size: cover;
            border: 1px solid #ccc;
            border-radius: 20px;
            margin-top: 7px;
            width: 300px;
            height: 400px;
            cursor: move;
            margin-left: auto;
            margin-right: auto;
        }

        .cropit-image-background {
            opacity: .2;
            cursor: auto;
        }

        input {
            padding-left: 7%;
        }

    </style>

</head>
<body>
<nav class="navbar navbar-default navbar-fixed-top lg-nav">
    <div class="container-fluid">
        <div class="navbar-header">
            <a class="navbar-brand" href="/">爱设团</a>
        </div>
        <div class="collapse navbar-collapse">
            <ul class="nav navbar-nav">
                <li class="dropdown nav-list">
                    <button class="dropdown-toggle btn btn-default nav-button" data-toggle="dropdown"
                            aria-expanded="false">
                        分类
                        <span class="caret"></span>
                    </button>
                    <ul class="dropdown-menu list" role="menu">

                        <li><a href="/design/listByCategory?category=4">分类四</a></li>


                        <li><a href="/design/listByCategory?category=2">分类二</a></li>


                        <li><a href="/design/listByCategory?category=3">分类三</a></li>


                        <li><a href="/design/listByCategory?category=1">分类一</a></li>

                    </ul>
                </li>
            </ul>
            <form class="navbar-form navbar-left" role="search">
                <div class="input-group">
                    <input type="text" class="form-control" placeholder="Search">
							<span class="input-group-btn">
								<button class="btn btn-default" type="button">搜索</button>
							</span>
                </div>
            </form>
            <ul class="nav navbar-nav">
                <li>
                    <a href="#">素材库</a>
                </li>
                <li>
                    <a href="/addDesign">我要设计</a>
                </li>
            </ul>

            <ul class="nav navbar-nav navbar-right">
                <li class="no-line">
                    <a href="">我的关注</a>
                </li>
                <li>
                    <div class="line"></div>
                </li>
                <li class="dropdown no-line">
                    <a href="javascript:void(0);" class="nav">消息&nbsp;<span class="badge"> new </span></a>

                    <div class="arrow"></div>
                    <ul class="dropdown-menu nav-mess">
                        <li class="nav-icon">
                            <ul class="nav nav-tabs">
                                <li role="presentation" class="active icon-trends"><a href="#"><span
                                        class="glyphicon glyphicon-th-list"></span></a></li>
                                <li role="presentation" class="icon-shop"><a href="#"><span
                                        class="glyphicon glyphicon-shopping-cart"></span></a></li>
                                <li role="presentation" class="icon-bell"><a href="#"><span
                                        class="glyphicon glyphicon-bell"></span></a></li>

                            </ul>
                        </li>
                        <li class="nav-mess-content">
                            <ul class="icon-trends mess-cur">
                                <li>
                                    <a href="">某人</a>
                                    <span>发布了</span>
                                    <a href="">某T恤</a>
                                </li>
                                <li>
                                    <a href="">某人</a>
                                    <span>发布了</span>
                                    <a href="">某T恤</a>
                                </li>
                                <li>
                                    <a href="">某人</a>
                                    <span>发布了</span>
                                    <a href="">某T恤</a>
                                </li>
                                <li>
                                    <a href="">某人</a>
                                    <span>发布了</span>
                                    <a href="">某T恤</a>
                                </li>
                                <li>
                                    <a href="/message/">查看更多...</a>
                                </li>
                            </ul>
                            <ul class="icon-shop">
                                <li>
                                    <a href="">某人</a>
                                    <span>预购了你的T恤</span>
                                    <a href="">某T恤</a>
                                </li>
                                <li>
                                    <a href="">某人</a>
                                    <span>预购了你收藏的T恤</span>
                                    <a href="">某T恤</a>
                                </li>
                                <li>
                                    <a href="#">查看更多...</a>
                                </li>
                            </ul>
                            <ul class="icon-bell">
                                <li>
                                    <a href="">某人</a>
                                    <span>赞了你的T恤</span>
                                    <a href="">某T恤</a>
                                </li>
                                <li>
                                    <a href="">某人</a>
                                    <span>赞了你在</span>
                                    <a href="">某T恤</a>
                                    <span>下的评论</span>
                                </li>
                                <li>
                                    <a href="#">查看更多...</a>
                                </li>
                            </ul>
                        </li>
                    </ul>
                </li>
                <li>
                    <div class="line"></div>
                </li>
                <li class="dropdown nav-account">
                    <a href="">
                        <img src="/images/avatar.jpg" alt="头像" class="nav-avatar"/>
                        <span>&nbsp;&nbsp;蓝白</span>
                        <span class="caret"></span>
                    </a>
                    <ul class="dropdown-menu" role="menu">
                        <li>
                            <a href="/user/userInfo?user=4">
                                <span class="glyphicon glyphicon-user"></span>
                                我的主页
                            </a>
                        </li>
                        <li>
                            <a href="#">
                                <span class="glyphicon glyphicon-envelope"></span>
                                站内信
                            </a>
                        </li>
                        <li>
                            <a href="#">
                                <span class="glyphicon glyphicon-cog"></span>
                                账号设置
                            </a>
                        </li>
                        <li>
                            <a href="/user/logout">
                                <span class="glyphicon glyphicon-off"></span>
                                退出账号
                            </a>
                        </li>
                    </ul>
                </li>
            </ul>

        </div>
    </div>
</nav>

<br>
<br>

<div class="container">

    <div class="col-md-4">

        <div class="panel panel-default">
            <div class="panel-body">
                <div class="row text-center">
                    <h3>最新素材</h3>
                </div>

                <div class="col-sm-12 row">

                    <div class="col-sm-6">
                        <a href="#" class="thumbnail">
                            <img src="images/tt/tt1.jpg" alt="...">
                        </a>
                    </div>

                    <div class="col-sm-6">
                        <a href="#" class="thumbnail">
                            <img src="images/tt/tt1.jpg" alt="...">
                        </a>
                    </div>

                    <div class="col-sm-6">
                        <a href="#" class="thumbnail">
                            <img src="images/tt/tt1.jpg" alt="...">
                        </a>
                    </div>

                    <div class="col-sm-6">
                        <a href="#" class="thumbnail">
                            <img src="images/tt/tt1.jpg" alt="...">
                        </a>
                    </div>
                </div>

            </div>
        </div>
    </div>

    <div class="col-md-8">
        <div class="panel panel-default">
            <div class="panel-body">
                <div class="row text-center">
                    <h2><span class="glyphicon glyphicon-scissors"></span>上传素材</h2>
                </div>

                <div class="image-editor">

                    <div class="row text-center">
                        <input type="file" class="cropit-image-input">
                    </div>


                    <div class="cropit-image-preview"></div>


                    <div class="row">
                        <div class="col-md-4 col-md-offset-4 text-center">
                            <p>调整大小</p>
                            <input type="range" class="cropit-image-zoom-input">
                        </div>
                    </div>

                    <div class="row text-center">
                        <button class="btn btn-primary conform" data-toggle="modal" data-target="#checkInfo">提交</button>
                    </div>

                </div>
            </div>
        </div>
    </div>


    <div class="modal fade" id="checkInfo" tabindex="-1" role="dialog" aria-labelledby="myModalLabel"
         aria-hidden="true">
        <div class="modal-dialog">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span
                            aria-hidden="true">&times;</span></button>
                    <h4 class="modal-title" id="myModalLabel">确认信息</h4>
                </div>

                <!--submit info-->
                <div class="submit-content">
                    <div class="modal-body">

                        <div class="input-group">
                            <span class="input-group-addon" id="title_label">描述</span>
                            <input type="text" id="title" class="form-control" placeholder="该素材的描述"
                                   aria-describedby="title_label">
                        </div>
                    </div>
                    <div class="modal-footer">
                        <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
                        <button type="button" class="btn btn-primary export">提交</button>
                    </div>
                </div>

                <!--loading...-->
                <div class="submit-bar" style="display: none">
                    <div class="modal-body">
                        <div class="progress">
                            <div class="progress-bar progress-bar-striped active" role="progressbar" aria-valuenow="45"
                                 aria-valuemin="0" aria-valuemax="100" style="width: 100%">
                                提交中...
                            </div>
                        </div>
                    </div>
                </div>

                <!--clear...-->
                <div class="submit-clear" style="display: none">
                    <div class="modal-body">
                        <div class="row">
                            <h2>提交成功!</h2>
                        </div>
                    </div>
                    <div class="modal-footer">
                        <button type="button" class="btn btn-default" data-dismiss="modal">继续添加</button>
                        <button type="button" class="btn btn-primary go-img">提交</button>
                    </div>
                </div>
            </div>
        </div>
    </div>


</div>

<script src="http://cdn.bootcss.com/jquery/1.11.2/jquery.min.js"></script>
<script src="http://cdn.bootcss.com/bootstrap/3.3.4/js/bootstrap.min.js"></script>
<script src="js/jquery.cropit.min.js"></script>
<script src="js/nav.js"></script>

<script>
    $(function () {
        $('.image-editor').cropit({
            imageState: {}
        });

        $('.conform').click(function () {
            $('.submit-content').show();
            $('.submit-bar').hide();
        });

        $('.export').click(function () {
            $('.submit-content').hide('fast');
            $('.submit-bar').show('fast');

            var imageData = $('.image-editor').cropit('export');
            var title=$('#title').val();
            b64 = imageData.substring(22);
            window.open(imageData);


            $.post("demo_test_post.asp",
                    {
                        content: b64,
                        title: title
                    },
                    function (data, status) {
                        alert("Data: " + data + "\nStatus: " + status);
                    });

        });


        $('.go-img').click(function () {
            $('.submit-content').hide('fast');
            $('.submit-bar').hide('fast');
            $('.submit-clear').show('fast');

        });
    });
</script>

</body>

</html>